package com.aboverock.module.system.validator.constraints;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import com.aboverock.common.enums.UserTypeEnum;
import com.aboverock.module.system.validator.constraintvalidators.UserTypeLimitValidator;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;

/**
 * 验证是否是限制的用户类型.
 *
 * @author Rock Wang
 */
@Documented
@Constraint(validatedBy = { UserTypeLimitValidator.class })
@Target({ FIELD, PARAMETER })
@Retention(RUNTIME)
public @interface UserTypeLimit {
    UserTypeEnum value();

    String message() default "{smart.constraints.Type.user.limit.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
